<template>
  <div class="im-srq-topInput" style="margin-top:5px">
    <div>
      <el-button size="mini" type="primary" @click="handleQuery"
        >查询</el-button
      >
    </div>
    <div class="im-srq-topInputList">
      <ul>
          <li>
            <el-input
              size="mini"
              v-model="palletCode"
              placeholder="请输入内容"
            ></el-input>
            <span>货位编码：</span>
          </li>
      </ul>
    </div>
  </div>
</template>
<script>
import { trayInfoSearch } from "@/utils/api.js";
export default {
  name: "ImSrqTopInput",
  data() {
    return {
      options1: [
        {
          value: "选项1",
          label: "歼十",
        },
        {
          value: "选项2",
          label: "歼十",
        },
      ],
      palletCode: "",
      pageSize:100,
      pageNumber:1,
    };
  },
  methods:{
    handleQuery(){
      trayInfoSearch({
        searchParams: {
          palletCode: this.palletCode,
        },
        pageParameter: {
          rows: this.pageSize,
          page: this.pageNumber,
        }
      }).then((res)=>{
        // 将条件查找的数据传给Table
        this.$bus.$emit("ImTiSearchData", res.data.responseBody);
        console.log("退货查询Search", res);
        if(res.data.retCode == 201) {
          this.$Alert({
            title: "失败",
            message: res.data.message,
            type: "error",
          });
        }
      })
    }
  },
  mounted(){
    this.$bus.$on('imTiPageSize',(e)=>{
      this.pageSize = e
    trayInfoSearch({
        searchParams: {
          palletCode: this.palletCode,
        },
        pageParameter: {
          rows: this.pageSize,
          page: this.pageNumber,
        }
      }).then((res)=>{
        // 将条件查找的数据传给Table
        this.$bus.$emit("ImTiSearchData", res.data.responseBody);
        console.log("退货查询Search", res);
      })
    })
    this.$bus.$on('imTiPageNumber',(e)=>{
      this.pageNumber = e
      returnQuerySearch({
        searchParams: {
          palletCode: this.palletCode,
        },
        pageParameter: {
          rows: this.pageSize,
          page: this.pageNumber,
        }
      }).then((res)=>{
        // 将条件查找的数据传给Table
        this.$bus.$emit("ImTiSearchData", res.data.responseBody);
        console.log("退货查询Search", res);
      })
    })
  }
};
</script>
<style scoped>
.el-select {
  width: 140px;
}
.el-input {
  width: 140px;
}
.im-srq-topInput {
  overflow: hidden;
}
.im-srq-topInputList {
  text-align: center;
}
.im-srq-topInput ul li {
  float: left;
  width: 23%;
  height: 30px;
  line-height: 30px;
  margin-right: 1%;
  margin-bottom: 5px;
}
.im-srq-topInput ul li span {
  float: right;
}
.im-srq-topInput ul li div {
  float: right;
}
</style>